#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>

typedef void (*FUN)();

struct A
{
	FUN _fun;
	int _a;
};

struct B
{
	A _a_;
	int _b;
};

void _fa()
{
	std::cout << "A:out" << std::endl;
}

void _fb()
{
	std::cout << "B:out" << std::endl;
}

void test()
{
	A a;
	B b;

	a._fun = _fa;
	b._a_._fun = _fb;

	A* p = &a;
	p->_fun();
	p = (A*)&b;
	p->_fun();
}

int main()
{
	test();
	return 0;
}